'use strict'

var arr = ['小明','小红','小刚'];


if(arr.length == 1){
    console.log("欢迎"+arr[arr.length-1]+"同学");
}
else {
    //var sum;
    for(var i = 0;i<arr.length-2;i++){
        console.log("欢迎"+arr.length-2+"同学");
    }

}